
sum = 20
sum1 = 20

def main():
    global sum
    sum = 30
    sum1 = 30
    print(sum)
    print(sum1)

if __name__ == '__main__':
    main()
    print(sum)
    print(sum1)

"声明该变量为全局变量"